package com.xmall.sys.controller;

import com.xmall.define.base.Result;
import com.xmall.define.dto.login.PermissionTreeDto;
import com.xmall.sys.define.request.permission.PermissionQueryRequest;
import com.xmall.sys.service.IPermissionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 系统权限
 */
@RequestMapping("/service/sys/permission")
@RestController
public class PermissionController {

    @Resource
    private IPermissionService permissionService;

    /**
     * 权限树
     */
    @GetMapping("/treeList")
    public Result<List<PermissionTreeDto>> treeList(PermissionQueryRequest request){
        List<PermissionTreeDto> permissionList = permissionService.treeList(request);
        return Result.success(permissionList);
    }
}
